#!/bin/sh

set -ex

HOST=arm-perf

executables=$(cross bench --target aarch64-unknown-linux-gnu --no-run 2>&1 | grep Executable | grep -oE 'target/aarch64-unknown-linux-gnu/[^)]+')

mkdir -p target/criterion/$HOST/criterion
rsync --compress --progress $executables $HOST:~
for e in $executables ; do
  ee=$(basename $e)
  ssh $HOST "set -e ; ./$ee --bench $@"
done
